package com.h3c.nem.dto.enums;

import com.h3c.nem.utils.AppBusinessException;

public enum TodoTaskNodeEnum {
    // 11 填写月度工作承诺；12 月度承诺审核；13 月度考核评价；
    // 21 填写转正计划；22 转正计划审核;23 转正考核评价；
    // 31 执行小任务；32 审核小任务；
    // 91 流程控制；92 转办；100 终止；99 已完成；
    NEW_WORK_NOTICE(10, "新员工考核信息维护流程"),
    MONTH_WORK_PROMISE(11, "填写月度工作承诺"),
    MONTH_PROMISE_APPROVAL(12, "月度承诺审核"),
    MONTH_EVALUATION(13, "月度考核评价"),
    REGULARIZATION_PLAN(21, "填写转正计划"),
    REGULARIZATION_PLAN_APPROVAL(22, "转正计划审核"),
    REGULARIZATION_EVALUATION(23, "转正考核评价"),
    TASK_EXECUTE(31, "执行小任务"),
    TASK_APPROVAL(32, "小任务审核"),
    ONE_MAIL(81,"一封信"),
    OFFER_MODIFY_BP_SUBMIT(50, "BP提交offer变更申请"),
    OFFER_MODIFY_APPROVAL_GBBZ(51, "干部部长审批"),
    OFFER_MODIFY_APPROVAL_MANAGER(52, "一级主管审批"),
    OFFER_MODIFY_APPROVAL_CHRO(53, "CHRO审批"),
    PROCESS_CONTROL(91, "流程控制"),
    TURN_TO_DO(92, "转办"),
    MANUAL_ABORT(93, "手动中止"),
    END(100, "终止"),
    FINISH(99, "已完成"),
    ;
    private final int value;
    private final String name;

    TodoTaskNodeEnum(int value,String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static TodoTaskNodeEnum getEnumByValue(int value) {
        for (TodoTaskNodeEnum todoTaskNodeEnum : TodoTaskNodeEnum.values()) {
            if (todoTaskNodeEnum.value == value) {
                return todoTaskNodeEnum;
            }
        }
        throw new AppBusinessException("没有该环节");
    }

    public static void main(String[] args) {
        System.out.println(getEnumByValue(1).toString());
    }
}
